Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typescript default plugin file #20046

Merged
merged 4 commits into from
Feb 4, 2022
Merged

Conversation

ImCesar
Copy link
Contributor

@ImCesar ImCesar commented Feb 4, 2022

In typescript projects the default pluginFile can be an index.ts file. Currently we always assumed it was a js file and would not complete migration correctly.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 4, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Feb 4, 2022



Test summary

17925 0 211 0Flakiness 1


Run details

Project cypress
Status Passed
Commit 05d2240
Started Feb 4, 2022 9:09 PM
Ended Feb 4, 2022 9:22 PM
Duration 12:14 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/e2e/cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@ImCesar ImCesar changed the title fix: typescript default plugin file fix: typescript default plugin file Feb 4, 2022
@ImCesar ImCesar changed the title fix: typescript default plugin file typescript default plugin file Feb 4, 2022
@ImCesar ImCesar changed the title typescript default plugin file fix: typescript default plugin file Feb 4, 2022
@tbiethman tbiethman removed their assignment Feb 4, 2022
return cfg.pluginsFile ? cfg.pluginsFile : DEFAULT_PLUGIN_PATH
return cfg.pluginsFile ? cfg.pluginsFile : pluginPath
} catch {
return cfg.pluginsFile ? cfg.pluginsFile : path.normalize('cypress/plugins/index.js')
Copy link
Contributor

@tbiethman tbiethman Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If cfg.pluginsFile is defined, can we return early?

  if (cfg.pluginsFile) {
    return cfg.pluginsFile
  }

  try {
    let pluginPath = path.normalize('cypress/plugins/index.ts')

    await fs.stat(path.join(root, pluginPath))

    return pluginPath
  } catch {
    return path.normalize('cypress/plugins/index.js')
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call

tbiethman
tbiethman previously approved these changes Feb 4, 2022
elevatebart
elevatebart previously approved these changes Feb 4, 2022
@ImCesar ImCesar changed the title fix: typescript default plugin file feat: typescript default plugin file Feb 4, 2022
@ImCesar ImCesar changed the title feat: typescript default plugin file fix: typescript default plugin file Feb 4, 2022
@ImCesar ImCesar dismissed stale reviews from elevatebart and tbiethman via 05d2240 February 4, 2022 21:04
@ImCesar ImCesar merged commit dcc06de into 10.0-release Feb 4, 2022
@ImCesar ImCesar deleted the fix-typescript-plugin-file branch February 4, 2022 21:50
tgriesser added a commit that referenced this pull request Feb 7, 2022
* 10.0-release:
  chore: make error more informative about migration to Cypress 10 (#20007)
  fix: remove shelljs in example build script, correct file renames
  fix: last step in the ct setup goes back to start  (#20030)
  fix: typescript default plugin file (#20046)
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)
  release 9.4.1 [skip ci]
  fix: trigger 9.4.1 build
  release 9.4.0 [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants